/*
 * Copyright (c) 2014 laidian. All Rights Reserved.
 * @author yaoyuming
 * @date  2020-04-08 16:44
 */
package com.yao.home;

import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author yaoyuming
 * @date 2020/04/08 16:44
 */

@Controller
@Slf4j
public class HomeController {

    /**
     * 功能描述 : 定位前端页面
     *
     * @param path
     * @author yaoyuming
     * @date 2020/3/19
     * @return {@link String}
     */
    @GetMapping("/{redirect}")
    public String loginPath(@PathVariable("redirect") String path) {
        log.info("path = {}",path);
        return path;
    }

    @GetMapping("/home/{first}/{redirect}")
    public String mulitRedir(@PathVariable("first") String first, @PathVariable("redirect") String path) {
        return first + StrUtil.C_SLASH + path;
    }

    /*@GetMapping("/console.html")
    public String mulitRedir() {
        return "/views/home/console.html";
    }*/


/*    @PreAuthorize("hasAuthority('ROLE_USER')")
    @RequestMapping(value="/admin/test1")
    @ResponseBody
    public String adminTest1() {
        return "ROLE_USER";
    }

    @PreAuthorize("hasAuthority('ROLE_ADMIN')")
    @RequestMapping("/admin/test2")
    @ResponseBody
    public String adminTest2() {
        return "ROLE_ADMIN";
    }*/
}